<template>
  <el-button :icon="obj.icon" class="flexAlign" type="primary" size="mini" @click="btnClick">
    <template v-if="obj.img">
      <img :src="obj.img" alt="" srcset="" />
    </template>
    {{ obj.title }}
  </el-button>
</template>
<script>
export default {
  name: "boxTitle",
  props: {
    obj: {
      type: Object,
      default: () => {
        return {
          title: "eee",
          img: require("@/assets/myself_img/icon_hammer.png"),
          icon: ""
        };
      },
    },
  },
  data() {
    return {};
  },
  methods: {
    btnClick() {
      this.$emit("btnClick");
    },
  },
  mounted() {},
};
</script>
<style lang="scss" scoped>
.flexAlign {
  display: flex;
  align-items: center;
  img {
    display: block;
    width: 18px;
    height: 18px;
    margin-right: 5px;
  }
  ::v-deep span {
    display: flex;
    align-items: center;
    line-height: 18px;
  }
}
</style>
